package com.towexin.config.shiro;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.towexin.application.system.domain.User;
import com.towexin.application.system.service.UserService;
import com.towexin.application.websocket.domain.MessageBody;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.SessionListener;
import org.apache.shiro.session.mgt.eis.MemorySessionDAO;
import org.apache.shiro.session.mgt.eis.SessionDAO;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessageSendingOperations;

/**
 * TODO
 *
 * @author Towexin
 * @version 1.0
 * @date 2021/8/20 11:38
 */

public class CustomizeSessionListener implements SessionListener {
    private static final Logger logger = LoggerFactory.getLogger(CustomizeSessionListener.class);

    @Override
    public void onStart(Session session) {
        logger.info("Session创建，sessionId={}", session.getId());
    }

    @Override
    public void onStop(Session session) {
        logger.info("Session停止，sessionId={}", session.getId());
    }

    @Override
    public void onExpiration(Session session) {
        logger.info("Session异常（过期），sessionId={}", session.getId());
    }
}
